﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace RedBit.UserVoice.Model
{
    public class UVForum : INotifyPropertyChanged
    {
        public UVForum()
        {
            m_Suggestions = new ObservableCollection<UVSuggestion>();
            m_Suggestions.CollectionChanged += (s, e) =>
            {
                NotifyPropertyChanged("Suggestions");
            };
        }

        private string m_Id;
        public string Id
        {
            get { return m_Id; }
            set
            {
                if (value != m_Id)
                {
                    m_Id = value;
                    NotifyPropertyChanged("Id");
                }
            }
        }

        private string m_Name;
        public string Name
        {
            get { return m_Name; }
            set
            {
                if (value != m_Name)
                {
                    m_Name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        private ObservableCollection<UVSuggestion> m_Suggestions;
        public ObservableCollection<UVSuggestion> Suggestions
        {
            get { return m_Suggestions; }
            set
            {
                if (value != m_Suggestions)
                {
                    m_Suggestions = value;
                    NotifyPropertyChanged("Suggestions");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string property)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }

    }
}
